home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 35 / q35.d81 / t.ps to font < prev    next >
Text File  |  2022-08-28  |  16KB  |  376 lines

  1.  
  2.  
  3.                 1 2 8   P R I N T   S H O P   T O   F O N T
  4.  
  5.                       Program and Text by Bob Markland
  6.  
  7.  
  8.     The primary reason for selecting a C-128 over a C-64, aside from the
  9. extra memory, is the 80-column mode. And here at LOADSTAR 128 nearly every
  10. program is in the 80-column mode.
  11.  
  12.     As you no doubt know, the C-128 uses the text-oriented 8563 Video
  13. Display Controller chip (VDC) to display the 80-column screen. Besides
  14. allowing longer screen lines, its advantages include vivid colors,
  15. additional attributes, and the ability to display two fonts (512 different
  16. characters) simultaneously. And, unlike the VIC chip which stores
  17. characters in ROM, the VDC chip's character sets are addressable in place.
  18.  
  19.     But, alas, there is a down side -- the VDC chip is text-oriented. There
  20. is a limited bit-map mode, but the 640 x 400 pixels eat up nearly all of
  21. the 8563's available memory. Ordinarily only the background and one
  22. foreground color is available --  you can cut the bit-map by 1/4 and regain
  23. color control -- but in any event the character sets are gone.
  24.  
  25.     An experienced (or masochistic) M/L programmer can overcome these
  26. problems, but few have even attempted it. And no adequate solution is
  27. available from BASIC. So, many 80-column programs lack the visual
  28. enhancements common to C-64 programs.
  29.  
  30.     How about a compromise? What if you could easily display a smaller
  31. graphic anywhere on the screen?
  32.  
  33.     Print Shop Icons are an ideal source for small graphics. Existing
  34. images are plentiful or you can use The Print Shop Companion to draw just
  35. the graphic you want. LOADSTAR's COMPLEAT PRINT SHOP disks contain over
  36. 2600 Print Shop icons. You're sure to find an icon in this collection to
  37. fit your needs.
  38.  
  39.     Armed with a good idea for a program and an icon library you're almost
  40. ready to begin, except for two major impediments. Print Shop 3-block icons
  41. are stored in a format totally unlike any Commodore screen or font storage.
  42. And, on the 80-column screen, if icons were displayed at their normal 11
  43. byte width, they would be "squashed" horizontally. So a utility is needed
  44. to alter the format and double the width, and 128 PRINT SHOP TO FONT does
  45. just that.
  46.  
  47.  
  48.  USING PRINT SHOP TO FONT
  49.  ------------------------
  50.  
  51.     128 PS TO FONT is a freestanding utility. You can write a program that
  52. uses only the utility and icons. However, it is also compatible with
  53. CONTROL80 and 128 RLE for more complex applications.
  54.  
  55.     First you must decide how you are going to make use of the PS icons. If
  56. your program will use only a few icons, you can store them on disk
  57. individually and BLOAD them as needed.
  58.  
  59.     When numerous icons are required you should bundle them into a single
  60. file. There are several ways to accomplish this, but here is the method I
  61. used for the demo:
  62.  
  63.   1) With no program in memory, enter the built-in MONITOR and fill an area
  64. of memory with a known value, let's say, BB.
  65.  
  66.          F 02000 04000 BB
  67.  
  68.      then exit the monitor.
  69.  
  70.   2) BLOAD all of your icons into successive areas of memory, 3 pages apart
  71. (768 bytes), from direct mode, as follows:
  72.  
  73.          BLOAD"Icon 1",B0,P8192
  74.          BLOAD"Icon 2",B0,P8960
  75.                  etc.
  76.  
  77.     There are two reasons for spacing the icons on page boundaries. First,
  78. a PS icon is 11 characters wide and 6-1/2 characters high. 128 PS TO FONT
  79. uses the 44 bytes beyond each icon as a work area to account for the stray
  80. 1/2 character. Second, it is easier to keep track of the indexing for
  81. multiple icons.
  82.  
  83.     You could write a 3-line Q&D program to read the icon names from DATA
  84. statements, increment the load address with a variable, and complete the
  85. above process in one operation. But, unless you plan to make several icon
  86. files, it may not be worth the bother.
  87.  
  88.   3) When all of your icons are in memory, enter the MONITOR again, and
  89. scan memory with the "M" command to find the ending address of the last
  90. icon plus one (+1). Note the address and exit the monitor.
  91.  
  92.   4) BSAVE the icons as a single file using the following syntax, where
  93. "start" is the beginning address of the first icon and "end" is the address
  94. of the end of the last icon:
  95.  
  96.  BSAVE"FILENAME,B0,Pstart TO Pend+1
  97.  
  98.  Or, if you're comfortable with the monitor, you could save the icons as a
  99. single file inside the monitor, using hex numbers and the S (save)
  100. command.
  101.  
  102.   5) If the icon file is relatively short you may wish to end the process
  103. at this point. Otherwise, use 128 RLE (Run Length Encoding) Packer/Unpacker
  104. to "PACK A FILE", thus creating a file which takes up less disk space and
  105. loads more quickly. Then include 128 RLE in your program to unpack the
  106. file.
  107.  
  108.     You are now ready to begin your program. There are six versions of 128
  109. PS TO FONT on disk and their file names indicate the necessary load
  110. address:
  111.  
  112.         128 PS-FONT 0C00
  113.         128 PS-FONT 1300
  114.         128 PS-FONT 1C00
  115.         128 PS-FONT 2400
  116.         128 PS-FONT 3500
  117.         128 PS-FONT 3800
  118.  
  119.     If you absolutely need a version at a location not found above, you can
  120. use Jeff Jones' ML MOVER from LS 64 #156 to create versions almost anywhere
  121. you want.
  122.  
  123.     Use BLOAD to load 128 PS TO FONT into bank 0, where dv is the number of
  124. the active device:
  125.  
  126.       BLOAD"128 PS-FONT xxxx",B0,U(dv)
  127.  
  128.     The choice of which version to use depends upon what else you have
  129. going on. If 128 PS TO FONT is the only utility you will be using, $0C00 or
  130. $1300 are perhaps the best choices. You will notice the accompanying demo
  131. uses both CONTROL80 and 128-RLE so the $1C00 version is the one to use. The
  132. remaining versions are intended to nestle among the various incarnations of
  133. CONTROL80, custom fonts, etc. If you choose to move the start of BASIC to
  134. $4000, any of the higher versions may be used, with or without other
  135. utilities.
  136.  
  137.  FENDER'S NOTE: When I use CONTROL80, I invariably move the start of BASIC
  138. up to $4000 with the GRAPHIC1,1:GRAPHIC0:GRAPHIC5 sequence. I've never
  139. written a 128 mode BASIC program so large that I needed BASIC to start at
  140. the normal $1300, or even $1C00. So why not move BASIC up to $4000 and use
  141. that open area from the top of CONTROL80 to $4000 for buffers, ML routines,
  142. etc.?
  143.  
  144.     128 PS TO FONT supports two different types of icon displays -- full-
  145. size and cropped. Full-size icons require 154 characters (22 x 7). As a
  146. result, only two different icons may be imbedded in the character sets. One
  147. in the upper portion of font 0 and the other in the upper portion of font
  148. 1.
  149.  
  150.     This not only limits the number of possibilities, but the 22 x 7 size
  151. doesn't space well on a 80 x 25 screen. Unless there is a critical need to
  152. display the entire icon, cropping is preferable.
  153.  
  154.     128 PS TO FONT can automatically crop an icon for you. The utility
  155. trims 2 rows of pixels from the top and bottom of the image and 4 pixels
  156. from both the left and right sides. The resulting image is 20 x 6
  157. characters in size. You may wish to take this into consideration when you
  158. select your icons, and use Print Shop Companion to edit them beforehand.
  159.  
  160.     Sixteen cropped icons fit nicely on the screen and you can store three
  161. different icons simultaneously, still leaving 128 character definitions for
  162. text.
  163.  
  164.     Numerous arrangements are possible, depending upon the needs of your
  165. program. Some of the possibilities include:
  166.  
  167.   1) Store one icon in the upper half of font 0 and another in the upper
  168. half of font 1. This leaves both uppercase and lowercase text intact.
  169.  
  170.   2) Reverse the above process, leaving both reversed character sets
  171. available.
  172.  
  173.   3) Store two icons in one font or the other. You then have one entire
  174. character set for text/graphics characters.
  175.  
  176.   4) Store two icons in one or the other font and one in half of the
  177. remaining font. 128 text characters remain available in either normal or
  178. reverse.
  179.  
  180.   It is theoretically possible to store four icons at one time. However,
  181. doing so will corrupt any text characters on the screen and prevent further
  182. use of text until at least one font is restored with CONTROL80's FCOPY.
  183.  
  184.     While it is not necessary to include a custom font, if you plan to
  185. write a program for LOADSTAR it is not likely to be accepted without one.
  186. Include CONTROL80 in your program and FCOPY a custom font